@@ -59,7 +59,10 @@ class @Utils |
||
| 59 | 59 |
""", |
| 60 | 60 |
body: (body) => |
| 61 | 61 |
form = $(body).find('.dry-run-form')
|
| 62 |
- window.setupJsonEditor(form.find('.payload-editor'))
|
|
| 62 |
+ payload_editor = form.find('.payload-editor')
|
|
| 63 |
+ if previous = $(button).data('payload')
|
|
| 64 |
+ payload_editor.text(previous) |
|
| 65 |
+ window.setupJsonEditor(payload_editor) |
|
| 63 | 66 |
form.submit (e) => |
| 64 | 67 |
e.preventDefault() |
| 65 | 68 |
json = $(e.target).find('.payload-editor').val()
|
@@ -79,8 +82,10 @@ class @Utils |
||
| 79 | 82 |
alert 'Event is required for this agent to run.' |
| 80 | 83 |
return |
| 81 | 84 |
dry_run_data = data |
| 85 |
+ $(button).data('payload', null)
|
|
| 82 | 86 |
else |
| 83 | 87 |
dry_run_data = "event=#{encodeURIComponent(json)}&#{data}"
|
| 88 |
+ $(button).data('payload', json)
|
|
| 84 | 89 |
$(body).closest('[role=dialog]').on 'hidden.bs.modal', =>
|
| 85 | 90 |
@invokeDryRun(url, dry_run_data, cleanup) |
| 86 | 91 |
.modal('hide')
|